package com.xhwl.data.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.common.pojo.cent.sdata.Position;
import com.xhwl.common.query.cent.sdata.PositionQuery;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@RestController
public interface IPositionService extends IService<Position> {

    ResultJson nameVerification(List<Position> positions);


    Page page(PositionQuery positionQuery, Page page);

    @RequestMapping(value = "/position-service/get-positionList", method = RequestMethod.POST)
    List<Position> list(@RequestPart("positionQuery") PositionQuery positionQuery);


    /**
     * 批量新增
     * @param positions
     * @return
     */
    ResultJson batchCreate(List<Position> positions);


    ResultJson create(Position position);


    ResultJson update(Position position);


    ResultJson delete(Integer id);


    /**
     * 岗位数据导出
     * @param response
     * @param positionQuery
     * @throws IOException
     */
    void positionExport(HttpServletResponse response, PositionQuery positionQuery) throws IOException;


    /**
     * 模板导出
     * @param response
     * @throws IOException
     */
    void exportTemp(HttpServletResponse response) throws IOException;


    /**
     * 岗位导入
     * @param file
     * @param enterpriseId
     * @return
     * @throws IOException
     */
    ResultJson readExcel(MultipartFile file, Integer enterpriseId) throws Exception;
}
